package marchsoft.modules.tiku.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import marchsoft.base.BasicMapper;
import marchsoft.modules.tiku.entity.EStudent;
import marchsoft.modules.tiku.entity.dto.StudentDto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;


/**
 * <p>
 * 学生基本信息表 Mapper 接口
 * </p>
 *
 * @author wjy
 * @since 2022-04-18
 */
@Component
public interface EStudentMapper extends BasicMapper<EStudent> {
    @Select("SELECT s.id,s.user_id,s.university_id,s.name ,s.sex,s.id_card,s.college,s.major,s.identity ," +
            "s.student_num,s.admission_num,s.enrollment_year,d.name as university_name FROM e_student s " +
            "LEFT JOIN sys_dept d ON s.university_id = d.id ${ew.customSqlSegment}")
    IPage<StudentDto> selectAllStudents(IPage<EStudent> buildPage, @Param(Constants.WRAPPER) QueryWrapper<EStudent> buildEStudentCriteria);
}